#ifndef _EquipDetail_h__
#define _EquipDetail_h__

#include "Global.h"
#include "EquipIcon.h"
struct AffixView
{
	CCLabelTTF* mAffixTitle;
	CCLabelTTF* mAffixValue;
};
class EquipDetail
	: public CCNode
	, public CCBMemberVariableAssigner
	, public CCBSelectorResolver
	, public CCNodeLoaderListener
	, public ViewBase
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(EquipDetail, create);
	static EquipDetail* create(CCObject* pOwer);

	EquipDetail(void);
	~EquipDetail(void);

	virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode);
	virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader);
	bool init();
	void refresh();
	void onEnter();
	void onExit();
	CCLabelTTF* mName;
	CCLabelTTF* mLevel;
	CCLabelTTF* mType;
	CCLabelTTF* mPropertyTitle;
	CCLabelTTF* mPropertyValue;
	CCLabelTTF* mAffix1Title;
	CCLabelTTF* mAffix1Value;
	CCLabelTTF* mAffix2Title;
	CCLabelTTF* mAffix2Value;
	CCLabelTTF* mAffix3Title;
	CCLabelTTF* mAffix3Value;
	CCLabelTTF* mAffix4Title;
	CCLabelTTF* mAffix4Value;
	EquipIcon* mEquipIcon;
private:
	std::vector<AffixView*> mAffixView;
	void _onNotification(CCObject* object);
	void onDoItClick(CCObject* pSender);
	void onSnatchBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onCloseBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
};

#endif